package com.fa4j.product.stock.controller;

import com.fa4j.common.base.model.Page;
import com.fa4j.common.web.annotation.ApiMethod;
import com.fa4j.common.web.model.AppType;
import com.fa4j.product.stock.model.Stock;
import com.fa4j.product.stock.model.StockPageQuery;
import com.fa4j.product.stock.repository.StockRepository;
import com.fa4j.product.stock.service.StockService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Web接口-商品库存
 *
 * @since 2025-11-22 21:06:24
 */
@RestController
@RequestMapping("product/stock")
@RequiredArgsConstructor
public class StockController {

    private final StockService stockService;
    private final StockRepository stockRepository;


    @GetMapping("page")
    @ApiMethod(name = "商品库存-分页查询", type = AppType.MANAGE)
    public Page<Stock> page(StockPageQuery query) {
        return stockRepository.queryPage(query);
    }
}

